package com.xindiantu.scope;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.Map;

import android.R.integer;
import android.content.Context;

public class ElectrocarddiogramUtil {
	public static String TEST_FILE_TAB = "\t";
	public static Map<Integer, Integer> readTestFile(Context context,int rId) throws IOException{
		InputStream is = context.getResources().openRawResource(rId);
		BufferedReader br = new BufferedReader(new InputStreamReader(is));
		//parse
		Map<Integer, Integer> map = new HashMap<Integer, Integer>();
		String line;
		while((line = br.readLine())!=null){
			String[] tmp = line.split(TEST_FILE_TAB);
			map.put(Integer.valueOf(tmp[0]), Integer.valueOf(tmp[1]));
		}
		return map;
 	}
}
